<?php

/**
 * AccountCustomer form base class.
 *
 * @method AccountCustomer getObject() Returns the current form's model object
 *
 * @package    erpcrm
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseAccountCustomerForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'contact_iden'       => new sfWidgetFormInputHidden(),
      'currency_code'      => new sfWidgetFormInputText(),
      'default_terms'      => new sfWidgetFormPropelChoice(array('model' => 'ListInvoiceTerms', 'add_empty' => false, 'key_method' => 'getTerm')),
      'status'             => new sfWidgetFormInputText(),
      'remarks'            => new sfWidgetFormTextarea(),
      'customer_industry'  => new sfWidgetFormTextarea(),
      'default_owner_iden' => new sfWidgetFormPropelChoice(array('model' => 'AccountOwner', 'add_empty' => false)),
      'tin_number'         => new sfWidgetFormInputText(),
      'credit_limit'       => new sfWidgetFormInputText(),
      'vat_excempt_type'   => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'contact_iden'       => new sfValidatorPropelChoice(array('model' => 'Contact', 'column' => 'iden', 'required' => false)),
      'currency_code'      => new sfValidatorString(array('max_length' => 10)),
      'default_terms'      => new sfValidatorPropelChoice(array('model' => 'ListInvoiceTerms', 'column' => 'term')),
      'status'             => new sfValidatorString(array('max_length' => 20)),
      'remarks'            => new sfValidatorString(),
      'customer_industry'  => new sfValidatorString(),
      'default_owner_iden' => new sfValidatorPropelChoice(array('model' => 'AccountOwner', 'column' => 'contact_iden')),
      'tin_number'         => new sfValidatorString(array('max_length' => 30)),
      'credit_limit'       => new sfValidatorNumber(),
      'vat_excempt_type'   => new sfValidatorString(array('max_length' => 20)),
    ));

    $this->widgetSchema->setNameFormat('account_customer[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'AccountCustomer';
  }


}
